//
//  TwoViewController.m
//  OCLockDemo
//
//  Created by lianglibao on 2018/12/22.
//  Copyright © 2018年 梁立保. All rights reserved.
//

#import "TwoViewController.h"
#import "PermenantThread.h"

@interface TwoViewController ()
@property (nonatomic, strong) PermenantThread *thread;
@end

@implementation TwoViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = NSStringFromClass(self.class);
    self.view.backgroundColor = [UIColor lightGrayColor];
    
    // 持有保活线程.
    self.thread = [PermenantThread new];
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
//    [self.thread executeTask:^{
//        NSLog(@"%s", __func__);
//    }];
    [self.thread executeTaskWithTarget:self selector:@selector(test:) withObject:@"object"];
}

- (void)test:(id)object {
    NSLog(@"%s---%@", __func__, object);
}


@end
